<?php

namespace App\Admin\Tools\Task;

use App\Models\TaskModel;
use Encore\Admin\Grid\Tools\AbstractTool;

class TaskDeleteTool extends AbstractTool
{
    private int $id;

    public function __construct(int $id)
    {
        $this->id = $id;
    }

    /**
     * @inheritDoc
     */
    public function render()
    {
        $task = TaskModel::query()->where('id', $this->id)->first();

        return view('task.task_delete', [
            'name' => $task->task_name,
            'id' => $this->id
        ]);
    }
}
